namespace BassettData.Robots.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FluentAssertions;
    using NUnit.Framework;

    [TestFixture]
    public class WorldFileReader
    {
        [TestFixtureSetUp]
        public static void TestSetup()
        {
            WorldReader reader = new WorldReader();
            reader.ReadFromFile("World1.kwld");
        }

        [Test]
        public void CanReadStreets()
        {
            World.Instance.NumberOfStreets.Should().Be(15);
        }

        [Test]
        public void CanReadAvenues()
        {
            World.Instance.NumberOfAvenues.Should().Be(20);
        }

        [Test]
        public void CanReadBeepers()
        {
            World.Instance.BeeperLocations.Count.Should().Be(2);
            World.Instance.BeeperLocations.Should().ContainKey(new Location(3, 4));
            World.Instance.BeeperLocations[new Location(3, 4)].Should().Be(1);

            World.Instance.BeeperLocations.Should().ContainKey(new Location(4, 2));
            World.Instance.BeeperLocations[new Location(4, 2)].Should().Be(1);
        }

        [Test]
        public void CanReadEastWestWalls()
        {
            World.Instance.EastWestWalls.Count.Should().Be(1);
            World.Instance.EastWestWalls.Should().Contain(new EastWestWallLocation(3, 2, 4));
        }

        [Test]
        public void CanReadNorthSouthWalls()
        {
            World.Instance.NorthSouthWalls.Count.Should().Be(4);
            World.Instance.NorthSouthWalls.Should().Contain(new NorthSouthWallLocation(4, 2, 2));
        }
    }
}
